package com.shaohai.live.adapter;

import android.content.Context;


import com.shaohai.live.R;
import com.shaohai.live.entity.RecyclerItemDescription;
import com.shaohai.live.ui.RecyclerViewHolder;

import java.util.List;

public class RecyclerItemAdapter extends BaseRecyclerAdapter<RecyclerItemDescription> {

    public RecyclerItemAdapter(Context ctx, List<RecyclerItemDescription> data) {
        super(ctx, data);
    }

    @Override
    public int getItemLayoutId(int viewType) {
        return R.layout.home_item_layout;
    }

    @Override
    public void bindData(RecyclerViewHolder holder, int position, RecyclerItemDescription item) {
        holder.getTextView(R.id.item_name).setText(item.name);
        if (item.iconRes != 0) {
            holder.getImageView(R.id.item_icon).setImageResource(item.iconRes);
        }
    }
}
